<include file="Public/header"/>

<link rel="stylesheet" href="/Public/admin/adminlte/bootstrap/css/bootstrap-datetimepicker.min.css">
<include file="Public/menu"/>
<!--<script src="__PUBLIC__/js/bootstrap-datepicker.js"></script>-->
<!-- 内容页 -->
<div class="content-wrapper">
    <!-- 面包屑 -->
    <section class="content-header">
        <h1>
            {$title}
            <small>{$title_two}</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> {$title}</a></li>
            <li class="active">{$title_two}</li>
        </ol>
    </section>
    <!-- 内容 -->
    <section class="content">
        <ul class="nav nav-tabs">
            <li <if condition='$view eq 3'>class="active"</if>><a href="{:U('Identity/index',['view'=>3])}">审核申请中</a></li>
            <li <if condition='$view eq 1'>class="active"</if>><a href="{:U('Identity/index',['view'=>1])}">审核通过</a></li>
            <li <if condition='$view eq 2'>class="active"</if>><a href="{:U('Identity/index',['view'=>2])}">审核失败</a></li>
            <li <if condition='$view eq 4'>class="active"</if>><a href="{:U('Identity/index',['view'=>4])}">全部</a></li>
            <li class="pull-right header"></li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane active" id="tab_0">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title"></h3>
                        <div class="form-inline pull-right">
                            <form action="{:U('Identity/index')}" method="get" pjax-container="">
                                <fieldset>

                                    <select class="form-control" name="select" style="height: 30px; font-size: 12px;">
                                        <option value="mobile" <if condition="$select eq 'mobile' "> selected = "selected"</if>>手机号</option>
                                        <option value="identity_card_num" <if condition="$select eq 'identity_card_num' "> selected = "selected"</if>>身份证号</option>
                                        <option value="identity_name" <if condition="$select eq 'identity_name' "> selected = "selected"</if>>身份证姓名</option>
                                        <option value="nickname" <if condition="$select eq 'nickname' "> selected = "selected"</if>>昵称</option>
                                    </select>
                                    <div class="input-group input-group-sm">
                                        <div class="input-group input-group-sm">
                                            <input type="text" class="form-control" placeholder="" name="value" value="{$value}">
                                        </div>
                                    </div>

                                    <div class="input-group input-group-sm">
                                        <div class="input-group-btn">
                                            <button type="submit" class="btn btn-primary"><i class="fa fa-search"></i>
                                            </button>
                                        </div>
                                    </div>
                                </fieldset>
                            </form>
                        </div>

                    </div>
                    <!-- /.box-header -->
                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <tbody>
                            <tr>
                                <th><input type="checkbox" class="grid-select-all"></th>
                                <th>ID<a id="a_order" rank='{$rank}' onclick="rankId('id','{$rank}')" class="fa fa-fw fa-sort" href="javascript:void(0);"></a>
                                </th>
                                <th>昵称</th>
                                <th>身份证姓名</th>
                                <th>身份证号</th>
                                <th>会员手机</th>
                                <th>审核图片</th>
                                <th>审核状态</th>
                                <th>操作</th>
                            </tr>
                            <foreach name="list" item="vo" >
                                <tr>
                                    <td><input type="checkbox" class="grid-item" data-id="{$vo.member_id}"></td>
                                    <td>{$vo.member_id}</td>
                                    <td>{$vo.nickname}</td>
                                    <td>{$vo.identity_name}</td>
                                    <td>{$vo.identity_card_num}</td>
                                    <td>{$vo.mobile}</td>
                                    <td>
                                        <img style="width:100px" src="{$vo.identity_photo}">
                                        <img style="width:100px" src="{$vo.identity_photo_1}">
                                    </td>
                                    <td>{:search(array('未申请审核','审核通过','审核失败','审核申请中'),$vo['identity_verifi'])}</td>
                                    <td>
                                        <if condition="$vo['identity_verifi'] eq '3'">
                                            <a href="javascript:void(0)" onclick="freezeMember('{$vo[member_id]}','1')" class="btn btn-sm btn-primary grid-refreshe">审核通过</a>&nbsp;&nbsp;
                                            <a href="javascript:void(0)" onclick="freezeMember('{$vo[member_id]}','2')" class="btn btn-sm btn-danger grid-refreshe">审核不通过</a>&nbsp;&nbsp;
                                        </if>
                                    </td>
                                </tr>
                            </foreach>

                            </tbody>
                        </table>
                    </div>
                    <div class="box-footer clearfix">
                        {$page}
                    </div>
                    <!-- /.box-body -->
                </div>
            </div>

        </div>
    </section>
</div>
<!-- 底部 -->
<include file="Public/common_footer"/>


<script type="text/javascript" src="/Public/admin/calendar/calendar.js"></script>
<link rel="stylesheet" type="text/css" href="/Public/admin/calendar/calendar-blue.css"/>
<script>

    var rankId = function(ran,order){
        window.location.href="{:U('Identity/index')}?"+ran+"="+order;
    }

    //审核
    var freezeMember = function(id,stat){
        $.post("{:U('Identity/audit')}", { "id": id,"status": stat },
            function(data){
                if(data.stat){
                    alert(data.msg);
                    window.location.reload();
                }else{
                    alert(data.msg);
                }
            }, "json");
    }

</script>

